package TestDemo;

class Student {
    private static int nextNo = 1908_0000;
    private int no;
    private String name;
    private String sex;
    private int age;
    private double java;

    public Student(String name, String sex, int age, double java) {
        this.no = nextNo++;
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.java = java;
    }

    public int getNo() {
        return no;
    }

    public String getName() {
        return name;
    }

    public String getSex() {
        return sex;
    }

    public int getAge() {
        return age;
    }

    public double getJava() {
        return java;
    }

    @Override
    public String toString() {
        return "no=" + no +
                ", name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                ", java=" + java;
    }
}

public class TestDemo1 {
    public static void main(String[] args) {
        Student student1 = new Student("zhangsan","male",18,60.5);
        Student student2 = new Student("lisi","female",24,90.5);
        System.out.println(student1);
        System.out.println(student2);
    }
}
